package com.example.apt_test;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.annotation.ARouter;

//自定义ARouter注解
@ARouter(path = "app/MainActivity")
public class MainActivity extends AppCompatActivity {
    private TextView tvOrder;
    private TextView tvUser;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tvOrder = (TextView) findViewById(R.id.tv_order);
        tvUser = (TextView) findViewById(R.id.tv_user);

        tvOrder.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Class targetClass = OrderActivity$$ARouter.findTargetClass("app/OrderActivity");
                startActivity(new Intent(MainActivity.this,targetClass));
            }
        });

        tvUser.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Class targetClass = UserActivity$$ARouter.findTargetClass("app/UserActivity");
                startActivity(new Intent(MainActivity.this,targetClass));
            }
        });
    }
}
